﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Forest.Web.Framework.UI
{
    public static class DropDownListHelper
    {
        public static SelectList GetMonthList(string defaultValue = "")
        {
            var listMonth = new List<SelectListItem>() 
            {
                new SelectListItem(){Value = "1",Text = "1"},
                new SelectListItem(){Value = "2",Text = "2"},
                new SelectListItem(){Value = "3",Text = "3"},
                new SelectListItem(){Value = "4",Text = "4"},
                new SelectListItem(){Value = "5",Text = "5"},
                new SelectListItem(){Value = "6",Text = "6"},
                new SelectListItem(){Value = "7",Text = "7"},
                new SelectListItem(){Value = "8",Text = "8"},
                new SelectListItem(){Value = "9",Text = "9"},
                new SelectListItem(){Value = "10",Text = "10"},
                new SelectListItem(){Value = "11",Text = "11"},
                new SelectListItem(){Value = "12",Text = "12"},
            };

            return new SelectList(listMonth, "Value", "Text", defaultValue);
        }

        public static SelectList GetDayList(string defaultValue = "")
        {
            var listDay = new List<SelectListItem>();
            for (int i = 1; i < 32; i++)
            {
                listDay.Add(new SelectListItem()
                    {
                        Value = i.ToString(),
                        Text = i.ToString()
                    });
            }

            return new SelectList(listDay, "Value", "Text", defaultValue);
        }
    }
}
